package org.xteam.camllight.io;

import java.io.IOException;
import java.io.PrintStream;

public class PrintStreamFileImpl implements IFile {

	private PrintStream stream;

	public PrintStreamFileImpl(PrintStream stream) {
		this.stream = stream;
	}

	public int read(byte[] buffer, int offset, int length) throws IOException {
		throw new RuntimeException("write only channel");
	}

	public void close() {
		
	}

	@Override
	public void write(byte[] buffer, int offset, int length) throws IOException {
		stream.write(buffer, offset, length);
	}

}
